<template>
	<div class="child">
		<h1>我是Child组件</h1>
		<h3>我有台电脑：{{computer}}</h3>
		<h3>父给我的车：{{car}}</h3>
		<button @click="getComputer(computer)">点我把电脑给父亲</button>
	</div>
</template>

<script>
	export default {
		name:'Child',
		props:['car','getComputer'],
		data() {
			return {
				computer:'联想拯救者Y7000P'
			}
		},
	}
</script>

<style>
	.child{
		background-color: skyblue;
		padding: 20px;
	}
</style>